Ext.namespace("Maint.Show63");

Maint.Show63.showInfo = function (){
	/* basic info */
    this.txtWoNum = new Ext.form.TextField({fieldLabel: '工单流水号',readOnly: true,width: 160 });
    this.txtCreateBy = new Ext.form.TextField({fieldLabel: '派单人',readOnly: true,width: 160 });
    this.txtContact = new Ext.form.TextField({fieldLabel: '联系方式',readOnly: true,width: 160 });
    this.txtDept = new Ext.form.TextField({fieldLabel: '派单部门',readOnly: true,width: 160 });
    this.txtCreateTime = new Ext.form.DateField({fieldLabel: '派单时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtTopic = new Ext.form.TextArea({fieldLabel: '工单主题',readOnly: true,width: 460,height: 40 });
    /* expand info */
    this.txtFalutType = new Ext.form.TextField({fieldLabel: '故障类型',readOnly: true,width: 160 });
    this.txtRequestLevel = new Ext.form.TextField({fieldLabel: '请求级别',readOnly: true,width: 160 });
    this.txtFaultFindTime = new Ext.form.DateField({fieldLabel: '故障发现时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtFaultEndTime = new Ext.form.DateField({fieldLabel: '故障结束时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtFaultDes = new Ext.form.TextField({fieldLabel: '故障描述',readOnly: true,width: 460 });
    this.txtPretreatment = new Ext.form.TextField({fieldLabel: '预处理情况和处理建议',readOnly: true,width: 460 });
    this.txtPigeonholeTime = new Ext.form.DateField({fieldLabel: '归档时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtPigeonholeNotion = new Ext.form.TextField({fieldLabel: '归档意见',readOnly: true,width: 460 });
    
    this.colseButton = new Ext.Button({
		text:"关闭",
		handler:function(){
			this.hide();
		},
		scope:this
	});
	
	this.basicPanel = new Ext.form.FormPanel({
		title:'工单基本信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtWoNum]},
			       {layout: 'form',items: [this.txtCreateBy]},
			       {layout: 'form',items: [this.txtContact]},
			       {layout:'form',items:[this.txtDept]},
			       {colspan: 2,layout:'form',items:[this.txtTopic]},
			       {layout:'form',items:[this.txtCreateTime]}
		]
	});
	  
	this.expandPanel = new Ext.form.FormPanel({
		title:'工单扩展信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtFalutType]},
			       {layout: 'form',items: [this.txtRequestLevel]},
			       {layout: 'form',items: [this.txtFaultFindTime]},
			       {layout: 'form',items: [this.txtFaultEndTime]},
			       {colspan: 2,layout: 'form',items: [this.txtFaultDes]},
			       {colspan: 2,layout: 'form',items: [this.txtPretreatment]},
			       {colspan: 2,layout: 'form',items: [this.txtPigeonholeNotion]},
			       {layout: 'form',items: [this.txtPigeonholeTime]}
		]
	});  
	
	this.mainPanel= new Ext.Panel({
		//height: bodyHeight-70,
		autoScroll: true,
		items: [this.basicPanel, this.expandPanel]
	}); 
	
	Maint.Show63.showInfo.superclass.constructor.call(this,{
		width:680,
		//height:bodyHeight,
		modal:true,
		autoScroll:false,
		closeAction:'hide',
		buttonAlign:'right',
		buttons:[this.colseButton],
		items:[this.mainPanel],
		listeners:{
		}
	});
	
};


Ext.extend(Maint.Show63.showInfo, Ext.Window, {
	initDetail: function(data){
		this.maintId = data.MAINT_ID;
		this.type = data.TYPE;
		this.txtWoNum.setValue(data.WO_NUM);
	    this.txtCreateBy.setValue(data.CREATE_BY);
	    this.txtContact.setValue(data.CONTACT);
	    this.txtDept.setValue(data.CREATE_DEP);
	    this.txtCreateTime.setValue(data.CREATE_TIME);
	    this.txtTopic.setValue(data.TOPIC);
	    this.txtFalutType.setValue(data.FALUT_TYPE);
	    this.txtRequestLevel.setValue(data.REQUEST_LEVEL);
	    this.txtFaultFindTime.setValue(data.FAULT_FIND_TIME);   
	    this.txtFaultEndTime.setValue(data.FAULT_END_TIME);
	    this.txtFaultDes.setValue(data.FALUT_DES);
	    this.txtPretreatment.setValue(data.PRETREATMENT);
	    this.txtPigeonholeTime.setValue(data.PIGEONHOLE_TIME);
	    this.txtPigeonholeNotion.setValue(data.PIGEONHOLE_NOTION);
	}
	/**
	update: function(){
		Ext.Ajax.request({
			url:'../supervise/UpdateById.form',
			scope:this,
			method:'POST',
			params:{
				txtWoNum: this.txtWoNum.getValue(),
				txtCreateBy: this.txtCreateBy.getValue(),
				txtContact: this.txtContact.getValue(),
				txtDept: this.txtDept.getValue(),
				txtCreateTime: this.txtCreateTime.getValue(),
				txtTopic: this.txtTopic.getValue(),
				txtFalutType: this.txtFalutType.getValue(),
				txtRequestLevel: this.txtRequestLevel.getValue(),
				txtFaultFindTime: this.txtFaultFindTime.getValue(),
				txtFaultEndTime: this.txtFaultEndTime.getValue(),
				txtFaultDes: this.txtFaultDes.getValue(),
				txtPretreatment: this.txtPretreatment.getValue(),
				txtPigeonholeTime: this.txtPigeonholeTime.getValue(),
				txtPigeonholeNotion: this.txtPigeonholeNotion.getValue(),
				maintId: this.maintId,
				maintType: this.type
			},
			success:function(resp, action){
				this.hide();
				Utils.info('修改成功!','系统提示');
				Maint.List.panel.instance = new Maint.List.panel();
				Maint.List.panel.instance.store.reload();
			},
			failure:function(){
				Utils.info('修改失败,请检查!','系统提示');
			}
		});	
	}
	**/
});